<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="../include/head.jspf"%>  

<head>
<title>东方易云后台管理系统</title>
<script language="javascript">
function addApplication(){
	var errorMsg = "";
	if(isNull($("#applicationName").val())){
		errorMsg += '<spring:message code="message.app.applicationName.is.blank" />';
	}
	if(isNull($("#applicationTypeKeyId").val())){
		errorMsg += '\n'+'<spring:message code="message.app.applicationType.is.blank" />';
	}
	if(isNull($("#appUrl").val())){
		errorMsg += '\n'+'<spring:message code="message.app.appUrl.is.blank" />';
	}
	if(isNull($("#applicationDesc").val())){
		errorMsg += '\n'+'<spring:message code="message.app.applicationDesc.is.blank" />';
	}
	if(isNull($("#imageUrl").val())){
		errorMsg += '\n'+'<spring:message code="message.app.imageUrl.is.blank" />';
	}
	if(isNull($("#supplier").val())){
		errorMsg += '\n'+'<spring:message code="message.app.supplier.is.blank" />';
	}
	if (checkRadioStat("status")==false){
		errorMsg += '\n'+'<spring:message code="message.app.status.not.select" />';
	}
	
	if(errorMsg != ""){
		alert(errorMsg);
		return;
	}else{
		$('#addForm').attr("action","/app/addSubmit");
		$('#addForm').submit();
	}
}
function validateCommomFlag(){
	if($("#commomFlag").checked==true){
		$("#commomFlag").attr("value","Y")
	}else{
		$("#commomFlag").attr("value","Y")
	}
	
	
}

function goBack(){
	$('#addForm').attr("action","/app/list");
	$('#addForm').submit();
}


</script>
</head>

<body>
<form  method="post" id="addForm">
<table border="1">
	<tr><td >增加用户组信息 </td></tr>
	<tr><td>应用名称:</td><td><input id="applicationName" name="applicationName" type="text"></td></tr>
	<tr><td>应用类别:</td>
	<td>
	<select name="applicationTypeKeyId" id="applicationTypeKeyId"  >
              <option value="" selected="selected">请选择</option>
              <c:forEach items="${applicationTypeMap}" var="one">
              <option value="${one.key}" ><c:out value="${one.value}"/></option>
              </c:forEach>
    </select>
	</td></tr>
	<tr><td>是否为普通应用:</td><td>是：<input id="commomFlag" name="commomFlag" type="radio" value="Y" checked="true"/> 否：<input id="commomFlag" name="commomFlag" type="radio"  value="N"  /></td>
	<tr><td>是否为实施应用:</td><td>是：<input id="implementFlag" name="implementFlag" type="radio" value="Y" checked="true"/> 否：<input id="implementFlag" name="implementFlag" type="radio"  value="N" /></td>
	<tr><td>应用的版本号:</td><td><input id="applicationVersion" name="applicationVersion" type="text"></td></tr>
	<tr><td>应用URL:</td><td><input id="appUrl" name="appUrl" type="text"></td></tr>
	<tr><td>应用描述:</td><td><input id="applicationDesc" name="applicationDesc" type="text"></td></tr>
	<tr><td>应用指导价格:</td><td><input id="price" name="price" type="text"></td></tr>
	<tr><td>应用图片:</td><td><input id="imageUrl" name="imageUrl" type="text"></td></tr>
	<tr><td>提供商:</td>
	<td>
	<select  name="supplier" id="supplier">
		<option value="" selected="selected">请选择</option>
			<c:forEach var="organizationVO" items="${findProviderList}" varStatus="oStatus">
				<option value="<c:out value='${organizationVO.organizationId}'/>" <c:if test="${organizationVO.organizationId eq providerNameSearch}">selected</c:if> ><c:out value='${organizationVO.chineseName}'/></option>
			</c:forEach> 
	</select>	
	</tr>
	<tr><td>应用状态:</td><td>启用：<input id="status" name="status" type="radio" value="1" /> 停用：<input id="status" name="status" type="radio"  value="0"  /></td></tr>
	<tr><td>文本域:</td><td><textarea name="memo"></textarea></td></tr>
	<tr><td><input type="button" value="确定" onclick="javascript:addApplication();"/><input type="button" value="取消" onclick="javascript:goBack();"/></td></tr>
</table>
</form>
</body>

</html>
